<?php

ini_set('display_errors',true);
session_start();

require_once("../classes/Factory.php");
require_once("../classes/project/TasksList.php");


// is user logged on ? --------------------------------------------
if (!isset($_SESSION['user'])) { header("location: ./logon.php"); }
// ----------------------------------------------------------------

$left="../templates/misc/menu.php";
$data="../templates/tasksList.php";
$userInfo = "../templates/misc/userInfo.php";
$alert = "";

$u = new SimpleXMLElement($_SESSION['user']);
$project = Factory::buildFromFile("Project", $_SESSION['project']);
$resources = $project->getResources();
$assignments = $project->getAssignments();
$timeSheet = Factory::buildFromFile("TimeSheet", $_SESSION['timesheet']);


		
if (isset($_GET['user'])) {
	$selectedUser = $_GET['user'];
}else {
	$selectedUser = (string) $u['uid'];
}

$tasksList = new TasksList( $project, $selectedUser );

include("../templates/main.php");

?>
